# Work done by myself!
#
# Copyright 2008 Lu,Xinlai, School of Software, Tsinghua University.
# All rights reserved.

PROJECT(visualization)

CMAKE_MINIMUM_REQUIRED(VERSION 2.4)

IF(COMMAND cmake_policy)
    cmake_policy(SET CMP0002 OLD)
    cmake_policy(SET CMP0003 NEW)
ENDIF(COMMAND cmake_policy)

IF(WIN32)
	SET(CR "'\\n'")
	SET(TAB "'	'")
	SET(SPACE "' '")
	SET(NON "'#'")
	SET(FILEOPEN "_s")
	SET(PARAM "&o_file,")  
ELSE(WIN32)
	SET(CR "13")
	SET(TAB "9")
	SET(SPACE "32")
	SET(NON "35")
	SET(FILEOPEN "")
	SET(PARAM "")  
ENDIF(WIN32)

SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
INCLUDE(glut)

IF(WIN32)
INCLUDE_DIRECTORIES(E:\\Qt\\include)
INCLUDE_DIRECTORIES(E:\\Qt\\include\\Qt)
LINK_DIRECTORIES(E:\\Qt\\lib)
ELSE(WIN32)
INCLUDE_DIRECTORIES(/usr/include/qt4)
INCLUDE_DIRECTORIES(/usr/include/qt4/Qt)
LINK_DIRECTORIES(/usr/lib)
ENDIF(WIN32)

SET(LIBRARIES_PATH ${PROJECT_SOURCE_DIR}/vis/common)
SET(STREAMER_PATH ${PROJECT_SOURCE_DIR}/vis/visualization/vectorField/visStreamers)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/vis/common CACHE INTERNAL "Library output directory")

SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/example CACHE INTERNAL "Executable output directory")
#IF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
#	SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/../bin/debug CACHE INTERNAL "Executable output directory")
#ELSE("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
#	SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/../bin/release CACHE INTERNAL "Executable output directory")
#ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
#
IF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
	SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS}   -Wall")
ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")

CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/vis/common/ucdinputfile.cpp.in ${PROJECT_SOURCE_DIR}/vis/common/ucdinputfile.cpp)
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/vis/visualization/vectorField/visLIC/visLic.cpp.in ${PROJECT_SOURCE_DIR}/vis/visualization/vectorField/visLIC/visLic.cpp)

ADD_SUBDIRECTORY(vis)
#ADD_SUBDIRECTORY(common)
#ADD_SUBDIRECTORY(visualization)
#ADD_SUBDIRECTORY(example)
##ADD_SUBDIRECTORY(display)
#ADD_SUBDIRECTORY(model)
#ADD_SUBDIRECTORY(vectorField)
#ADD_SUBDIRECTORY(scalarField)

